Skip to content

feat: Capabilities registry, EmptyState and DangerZone components - #34

Merged
roble merged 1 commit into
mainfrom
dev-2026-10-31
Oct 31, 2026
Merged

roble merged 1 commit into
mainfrom
dev-2026-10-31

Conversation

@roble

@roble roble commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Capabilities registry (+ facade): modules declare grouped capabilities in routes/capabilities.php (e.g. api token scopes, billing feature keys). Missing label/description fall back to the key and ''.
  • Loaded from every installed module by CoreServiceProvider.
  • New shared UI: EmptyState and DangerZone for both stacks (Vue + React), exported from components/ui/saucebase.
  • Module development skill documents capabilities.

Tests

  • tests/Feature/CapabilitiesTest.php + fixture module routes/capabilities.php.

After merge

Release 2.8, then bump modules to ^2.8.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added capability catalogs that combine declarations from the app and installed modules, with support for grouped entries and lazy registration.
    • Added reusable Danger Zone and Empty State components for React and Vue.
  • Documentation
    • Documented capability groups, registration options, label defaults, and setup guidance.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

This change adds a grouped capability catalog for application and module declarations, exposes it through the Laravel container and facade, and documents its use. It also adds and exports DangerZone and EmptyState components for React and Vue.

Changes: Capability Catalog

Layer / File(s) Summary
Capability registration and loading
src/Capabilities.php
The catalog stores entries by group, loads existing application and module capability files once per instance, and evaluates callback entries when a group is read. It translates labels and descriptions and preserves other entry fields.
Container access and validation
src/CoreServiceProvider.php, src/Facades/Capabilities.php, tests/Feature/CapabilitiesTest.php, tests/Fixtures/modules/module-test-fixture/routes/capabilities.php, resources/boost/skills/saucebase-module-development/SKILL.md
The service provider registers the catalog as a singleton, and the facade resolves it. Tests and fixture declarations cover grouping, lazy callbacks, fallback labels, and instance reuse. The module guide documents capability registration.

React and Vue UI Components

Layer / File(s) Summary
DangerZone and EmptyState components
stubs/stack/react/js/components/ui/saucebase/DangerZone.tsx, stubs/stack/react/js/components/ui/saucebase/EmptyState.tsx, stubs/stack/react/js/components/ui/saucebase/index.ts, stubs/stack/vue/js/components/ui/saucebase/DangerZone.vue, stubs/stack/vue/js/components/ui/saucebase/EmptyState.vue, stubs/stack/vue/js/components/ui/saucebase/index.ts
Both stacks add and export DangerZone and EmptyState. DangerZone supports a configurable header and title fallback. EmptyState renders a title and optional description, icon, and content.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Low · up to 310f5

Numeric capability keys can change, test isolation can produce unexpected catalogs, and heading navigation misses the React danger-zone title. These are bounded issues suitable for follow-up.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@roble
roble merged commit 97e6734 into main Oct 31, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant